<?php
$this->pageTitle = Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label());
$this->menu = array(
    array('label' => Yii::t('app', 'Create') . ' ' . $model->label(), 'url' => array('create')),
);
?>

<h3><?php echo Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label(2)); ?></h3>

<script type="text/javascript">
    function ChangeStatus(id, status)
    {   $.ajax({
            url: "<?php echo $statusChangeUrl; ?>",   
            type: "post", 
            data: "id=" + id + "&status=" + status, 
            dataType:"html",
		
            success: function(msg){
                $('#target-audience-grid').yiiGridView.update('target-audience-grid');
            }
        });
    } 
</script>

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'target-audience-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        /* 'id', */
        'target_audience_name',
        /*'create_time',*/
		
        array(
            'name' => 'create_time',
            'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                'model' => $model,
                'attribute' => 'create_time',
                'language' => 'en',
                'options' => array(
                    'dateFormat' => 'yy-mm-dd',
                ),
                    ), true),
        ),
		
		
        array(
            'name' => 'status',
            'type' => 'raw',
            'value' => 'changeStatusIngridView($data)',
            'filter' => array('0' => Yii::t('app', 'Inactive'), '1' => Yii::t('app', 'Active')),
        ),
        array(
            'class' => 'CButtonColumn',
        ),
    ),
));
?>